package net.pascalalma.hadoop;

import java.io.IOException;
import java.util.StringTokenizer;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class WordMapper extends Mapper <Text,Text,Text,Text>{

	
	private Text word= new Text();
	
	@Override
	protected void map(Text key, Text value, Mapper<Text, Text, Text, Text>.Context context)
			throws IOException, InterruptedException {
		// TODO 자동 생성된 메소드 스텁
		StringTokenizer itr =new StringTokenizer(value.toString());
		
		while(itr.hasMoreTokens()){
			word.set(itr.nextToken());
			context.write(key, word);
		}
	}

	
	  
	
}
